<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.log(0);
        for (var i = 0; i < 5; i++) {
            console.log(i);
        }
        function fn(a) {
            console.log('fn1');
            // setTimeout(a, 0) // 运行结果： 0 01234 fn1 fn2 over fn
            a() // 运行结果： 0 01234 fn1 fn fn2 over
            console.log('fn2');
        }
        fn(function() {
            console.log('fn');
        })
        console.log('over');
    </script>
</body>
</html>